﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;

namespace CorpAbreu.Common.Models
{
    public class BindData : INotifyPropertyChanged
    {
        private String _name;
        private String _code;
        private String _codename;
        private int _id;

        public String Name
        {
            get { return _name; }
            set { _name = value; 
                    if(PropertyChanged != null)
                        PropertyChanged(this, new PropertyChangedEventArgs("Name"));
                }
        }

        public String CodeName
        {
            get { return _codename; }
            set
            {
                _codename = value;
                if (PropertyChanged != null)
                    PropertyChanged(this, new PropertyChangedEventArgs("Name"));
            }
        }

        public int ID
        {
            get { return _id; }
            set { _id = value; 
                if (PropertyChanged != null)
                    PropertyChanged(this, new PropertyChangedEventArgs("ID"));
            }
        }

        public String Code
        {
            get { return _code; }
            set { _code = value;
                if (PropertyChanged != null)
                    PropertyChanged(this, new PropertyChangedEventArgs("Code"));
            }
        }

        public BindData(int id, string name)
        {
            ID = id;
            Name = name;
        }

        public BindData(String code, String name)
        {
            Code = code;
            Name = name;
        }

        public BindData(String code, String name, String codename)
        {
            Code = code;
            Name = name;
            CodeName = codename;
        }

        public event PropertyChangedEventHandler PropertyChanged;
    }
}
